import Vue from 'vue'

const UpdatePopConstructor = Vue.extend(require('./update.vue'))
let instance = null
let getAnInstance = () => {
  if (!instance) {
    instance = new UpdatePopConstructor({
      el: document.createElement('div')
    })
  }
  return instance
}

let update = () => {
  let instance = getAnInstance()
  let app = document.getElementById('app')
  app.appendChild(instance.$el)
  Vue.nextTick(function() {
    instance.appDownPersent = 0
    instance.show = true
  })
  return instance
}

export default update
